﻿Public Class MuhOdemeEmriCekListesi
	Inherits ProcessReport

	Dim eno As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Ödeme Emri Çek Listesi", "Ödeme emri numarasını girin.")
				eno = AddOdemeEmri()
			Case EventType.ValidateForm
				Rs = Muhasebe.OdemeEmri.CekListesi(Remote, eno.Get)
				If Check("eno", Rs.EOF, "Ödeme emri bulunamadı.") Then Return
				e.Result = True
			Case EventType.PageHeader
				Report.PrintReportInfo("ÖDEME EMRİ ÇEK LİSTESİ", "ÖDEME EMRİ NO.: " & eno.Get)
				Report.SetColumns("Ref.no.;Tarih;Kimlik;Kişi/Kuruluş;Tutar;Çek no.", "2;2;2;5;2;2", "c;d;c;l;m;c", "--")
			Case EventType.ReportDetail
				For Each Row In Rs
					Report.Print(Rs("cekno"), Rs("tarih"), Rs("kimlik"), Rs("kime"), Rs("miktar"), Rs("ceknoyeni"))
				Next
				Report.PrintTotal("<cs=4><r>" & Rs.Count & " ADET ÇEK, TOPLAM", Rs.Sum("miktar"), "")
		End Select
	End Sub

End Class
